<%@page import="org.kd.ssh.domain.History"%>
<%@page import="java.util.List"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>历史记录</title>
<link rel="stylesheet" type="text/css"
	href="<c:url value='/css/maple.css'/>"></link>
<style type="text/css">
.tx td {
	padding: 3px;
}

.store {
	width: 100%;
	border: 1px solid gray;
	border-collapse: collapse;
}

.store td {
	border: 1px solid gray;
	padding: 3px;
}

.store a {
	text-decoration: underline;
	color: blue;
}
</style>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-1.8.3.js"></script>
<script type="text/javascript">
	$(function() {
		$.post("${pageContext.request.contextPath}/store_ajaxList.action",
				function(data) {
					//console.info(data);
					for ( var i = 0; i < data.stores.length; i++) {
						var $option = "<option value='"+data.stores[i].id+"'>"
								+ data.stores[i].name + "</option>";
						$("#storeSelect").append($option);
					}
				});
	});
</script>
</head>
<%
	//List<History> histories = request.getAttribute("histories");
	//System.out.println(request.getAttribute("histories"));
%>
<body>
<s:debug></s:debug>
	<table border="0" class="tx" width="100%">
		<tr>
			<td>当前位置&gt;&gt;首页&gt;&gt;出入库记录</td>
		</tr>
	</table>
	<br>
	<table border="0" width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td rowspan="1">
				<form action="<c:url value='/jsps/store/remain.jsp'/>" method="post"
					name="select">
					<s:form action="query_history" method="post" name="select"
						theme="simple">
						<table width="100%" border="0" cellpadding="0" cellspacing="0"
							class="tx" align="center">
							<colgroup>
								<col width="20%" align="right">
								<col width="*%" align="left">
							</colgroup>
							<tr>
								<td bgcolor="a0c0c0" style="padding-left: 10px;" colspan="2"
									align="left"><b>查询条件：</b></td>
							</tr>
							<tr>
								<td>简记码：</td>
								<td><s:textfield cssClass="tx" name="nm"></s:textfield></td>
							</tr>
							<tr>
								<td>货物名称：</td>
								<td><s:textfield cssClass="tx" name="name"></s:textfield></td>
							</tr>
							<tr>
								<td>选择仓库：</td>
								<td><select class="tx" style="width: 120px;"
									name="store_id" id="storeSelect">
										<option>请选择</option>
								</select></td>
							</tr>
							<tr>
								<td colspan="2" align="right" style="padding-top: 10px;"><input
									class="tx" style="width: 120px; margin-right: 30px;"
									type="button" onclick="document.forms[0].submit();" value="查询">
								</td>
							</tr>
						</table>
					</s:form>
			</td>
			<td valign="top" width="20%">
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td background="<c:url value='/picture/loginpage.gif'/>"
							align="center"><br> <font color="red">操作步骤</font></td>
					</tr>
					<tr>
						<td background="<c:url value='/picture/bg1.jpg'/>"
							style="padding-left: 10px;">1.显示某种货物的出入库记录 <br />
							2.根据条件查询某种货的库存情况
						</td>
					</tr>
					<tr>
						<td><img src="<c:url value='/picture/bottom.jpg'/>"></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr valign="top">
			<td rowspan="2">
				<form action="" method="post" name="select">
					<table width="100%" border="0" cellpadding="0" cellspacing="0"
						class="tx" align="center">
						<colgroup>
							<col width="20%" align="right">
							<col width="*%" align="left">
						</colgroup>
						<tr>
							<td bgcolor="a0c0c0" style="padding-left: 10px;" colspan="1"
								align="left"><b>货物库存：</b></td>
						</tr>
						<tr>
							<td>
								<table class="store">
									<tr style="background: #D2E9FF; text-align: center;">
										<td>简记码</td>
										<td>名称</td>
										<td>时间</td>
										<td>类型</td>
										<td>单位</td>
										<td>数量</td>
										<td>库存余量</td>
										<td>仓库</td>
										<td>操作员</td>
									</tr>
									<s:iterator value="#request.histories" var="history">
										<tr>
											<td>ThinkPad</td>
											<td>联想笔记本</td>
											<td><s:property value="#history.storeTime" /></td>
											<td><s:property value="type" /></td>
											<td>台</td>
											<td><s:property value="amount" /></td>
											<td><s:property value="remain" /></td>
											<td>主2号仓库</td>
											<td><s:property value="user" /></td>
										</tr>
									</s:iterator>
								</table>
							</td>
						</tr>
					</table>
				</form>
			</td>
		</tr>
	</table>
</body>
</html>

